<template>
<view>
<view class="pay-warp">
  <view class="pay">
    <view class="code">
      <text>订单号：201803041723170000</text>
    </view>
    <view class="unpaid fr">
      <text>编辑</text>
    </view>
  </view>
  <view class="goods-list">
    <view class="list-pic fl">
      <image></image>
      <image></image>
      <image></image>
      <image></image>
      <image></image>
    </view>
  </view>
</view>
<view class="r-warp">
  <view class="r-cause">
    <picker @change="bindCauseChange" :value="index" :range="cause">
      退款原因
      <view class="fr r-choice">
        <view class="r-title">{{choice}}</view>
        <image src="/static/remao_shop/img/arrow_icon.png"></image>
      </view>
    </picker>
  </view>
</view>
<view class="r-warp">
  <view class="r-cause">
    退款金额：
    <text>￥2156.00</text>
  </view>
</view>
<view class="r-warp">
  <view class="r-cause">
    退款说明
    <input type="text" placeholder="选填"></input>
  </view>
  <view class="r-photo">
    <view class="camera">
      <image src="/static/remao_shop/img/camera_icon.png"></image>
      <text>添加照片</text>
    </view>
  </view>
</view>
<view class="submit">
  <text>提交</text>
</view>
</view>
</template>

<script>
// var util = require('../../utils/util.js');
// import request from '../../utils/requestUtils.js';
// import {
//   xcxId,
//   refund_url
// } from "../../utils/data.js";
var app = getApp();

export default {
  data() {
    return {
      choice: "请选择",
      cause: ["1", "2", "3", "4", "5"]
    };
  },

  components: {},
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.refund();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
  methods: {
    bindCauseChange: function (e) {
      this.setData({
        choice: this.cause[e.detail.value]
      });
    },
    refund: function (orderId) {
      var openId = wx.getStorageSync("openid");
      var $this = this;
      var params = {
        orderId: ""
      };
      request.POST({
        url: refund_url,
        params: params,
        header: request.postHeader,
        success: function (res) {
          var resultData = res.data.data;
          console.log(resultData);
          $this.setData({});
        },
        fail: function (res) {//失败后的逻辑
        }
      });
    }
  }
};
</script>
<style>
@import "./refund.css";
</style>